package com.ts.test;

import com.gitee.apanlh.util.algorithm.encrypt.symmetric.AES;
import com.gitee.apanlh.util.base.MapUtils;
import com.gitee.apanlh.util.dataformat.JsonUtils;
import com.gitee.apanlh.util.encode.HexUtils;

/**
 *  H5渠道采量联登手机号模式
 *
 *  @author Pan
 */
public class H5ChannelFederatePhone {

    public static void main(String[] args) {
        String key = "8cf70e3cf21ab7c1bca151943e6b2df80ba6a8d9b217940ac6c6b53ca8d6ea5e";
        AES ecb = AES.createEcb(HexUtils.decode(key));

        String json = JsonUtils.toJson(MapUtils.newHashMap(newMap -> {
            newMap.put("data", ecb.encryptToHex(JsonUtils.toJson(MapUtils.newHashMap(dataMap -> dataMap.put("phone", "18650745603")))));
        }));
        System.out.println(json);
    }
}
